import React from "react"

import SearchInput from "../SearchInput"
import "./style.less"

export default class SearchHeader extends React.Component{
	
	clickHandlerBack(e){
		window.history.back();
	}

	enterHandle(key){
		this.props.history.push("/search/"+ encodeURIComponent(key) );
	}

	render(){
	    return(
			<div className="searchHeader">
				<span className="back-icon" onClick={this.clickHandlerBack.bind(this)}>
					<i className="iconfont icon-zuo"></i>
				</span>
				<a className="home-header-right" href="#">
					<i className="iconfont icon-daohanggouwuche"></i>
				</a>
				<div className="home-header-middle">
					<div className="search-container">
						<i className="iconfont icon-sousuo1"></i>
						<SearchInput enterHandle={ this.enterHandle.bind(this) } />
					</div>
				</div>
			</div>
	    )
	}
}


